package com.dal.rpc.producer.service;

import com.dal.rpc.api.HelloService;
import com.dal.rpc.api.domain.User;
import com.dal.rpc.core.annotation.RpcService;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @program: dal-springboot
 * @description:
 * @author: jian
 * @create: 2021-11-18 14:01
 */
@RpcService(value = HelloService.class,version = "1.0")
public class HelloServiceImpl implements HelloService{
    @Override
    public String sysHello() {
        return "你好呀";
    }

    @Override
    public List<User> findAll() {
        List<User> users = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            User user = new User();
            user.setUsername("test"+i);
            user.setPassword(UUID.randomUUID().toString());
            users.add(user);
        }
        return users;
    }
}
